return g_object_new (ST_TYPE_ICON, NULL);
}
+/**
+ * st_icon_get_icon_name:
+ * @icon: an #StIcon
+ *
+ * This is a convenience method to get the icon name of the #GThemedIcon that
+ * is currently set.
+ *
+ * Returns: (transfer none): The name of the icon or %NULL if no icon is set
+ */
const gchar *
st_icon_get_icon_name (StIcon *icon)
{
return NULL;
}
+/**
+ * st_icon_set_icon_name:
+ * @icon: an #StIcon
+ * @icon_name: (nullable): the name of the icon
+ *
+ * This is a convenience method to set the #GIcon to a #GThemedIcon created
+ * using the given icon name. If @icon_name is an empty string, %NULL or
+ * fails to load, the fallback icon will be shown.
+ */
void
st_icon_set_icon_name (StIcon *icon,
const gchar *icon_name)
/**
* st_icon_get_gicon:
- * @icon: an icon
+ * @icon: an #StIcon
+ *
+ * Gets the current #GIcon in use.
*
- * Return value: (transfer none): the override GIcon, if set, or NULL
+ * Returns: (transfer none): The current #GIcon, if set, otherwise %NULL
*/
GIcon *
st_icon_get_gicon (StIcon *icon)
/**
* st_icon_set_gicon:
- * @icon: an icon
- * @gicon: (nullable): a #GIcon to override :icon-name
+ * @icon: an #StIcon
+ * @gicon: (nullable): a #GIcon
+ *
+ * Sets a #GIcon to show for the icon. If @gicon is %NULL or fails to load,
+ * the fallback icon set using st_icon_set_fallback_icon() will be shown.
*/
void
st_icon_set_gicon (StIcon *icon, GIcon *gicon)
/**
* st_icon_get_icon_size:
- * @icon: an icon
+ * @icon: an #StIcon
*
- * Gets the size explicit size on the icon. This is not necesariily
- * the size that the icon will actually be displayed at.
+ * Gets the explicit size set using st_icon_set_icon_size() for the icon.
+ * This is not necessarily the size that the icon will be displayed at.
*
- * Return value: the size explicitly set, or -1 if no size has been set
+ * Returns: The explicitly set size, or -1 if no size has been set
*/
gint
st_icon_get_icon_size (StIcon *icon)
/**
* st_icon_set_icon_size:
- * @icon: an icon
+ * @icon: an #StIcon
* @size: if positive, the new size, otherwise the size will be
* derived from the current style
*
- * Sets an explicit size for the icon.
+ * Sets an explicit size for the icon. Setting @size to -1 will use the size
+ * defined by the current style or the default icon size.
*/
void
st_icon_set_icon_size (StIcon *icon,
}
}
+/**
+ * st_icon_get_fallback_icon_name:
+ * @icon: an #StIcon
+ *
+ * This is a convenience method to get the icon name of the fallback
+ * #GThemedIcon that is currently set.
+ *
+ * Returns: (transfer none): The name of the icon or %NULL if no icon is set
+ */
const gchar *
st_icon_get_fallback_icon_name (StIcon *icon)
{
return NULL;
}
+/**
+ * st_icon_set_fallback_icon_name:
+ * @icon: an #StIcon
+ * @fallback_icon_name: (nullable): the name of the fallback icon
+ *
+ * This is a convenience method to set the fallback #GIcon to a #GThemedIcon
+ * created using the given icon name. If @fallback_icon_name is an empty
+ * string, %NULL or fails to load, the icon is unset and no texture will
+ * be visible for the fallback icon.
+ */
void
st_icon_set_fallback_icon_name (StIcon *icon,
const gchar *fallback_icon_name)